<include file="public/header"/>

<body>

<!--main-->
<style type="text/css">
body{ background:#f4f4f4;}
</style>
<div class="pPersonal-head">
<a href="javascript:;" class="tuic" onclick="logout()">退出登录</a>
  <div class="pic">
    <img src="{$user.head_img}" class="enlargeImg"> <a href="{:U('User/edit_info')}" class="mod iconfont">&#xe66b;</a>
  </div>
  <h3 class="name">{$user.username}</h3>
  <div class="level">
    普通会员>
  </div>
</div>

<script>
    function logout(){
        layer.confirm('确认退出？', function () {
            $.ajax({
                type: 'post',
                url: "/home/user/logout.html",
                data: {type: 1},
                dataType: 'json',
                success: function (result) {
                    if (result.status == 200) {
                        layer.msg(result.msg,{icon:1,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                    } else {
                        layer.msg(result.msg,{icon:2,time:2000},function(){if(result.url){ window.location.href = result.url;}});
                    }
                }
            })
        });
    }
</script>

<ul class="pPersonal-data clearfix">
    <a href="{:U('User/balance')}">
      <li>
        <p class="num">￥{$user.balance}</p>
        <p>我的余额</p>
      </li>
    </a>
  <li>
    <p class="num">{$user.integral}</p>
    <p>我的积分</p>
  </li>
  <li>
    <p class="num">{$user.yhj_count}</p>
    <p>优惠券</p>
  </li>
</ul>
<div class="pPersonal-menu clearfix">
  <div class="iboxt clearfix">
    <a href="{:U('Order/recharge')}"> <i class="icon"><img src="__PUBLIC__/home/images/pPersonal-i1.png"></i>
      <h3 class="tit">会员充值</h3>
    </a>
    <a href="{:U('Order/index')}"> <i class="icon"><img src="__PUBLIC__/home/images/pPersonal-i2.png"></i>
      <h3 class="tit">我的订单</h3>
    </a>
    <a href="{:U('Order/expense')}"> <i class="icon"><img src="__PUBLIC__/home/images/pPersonal-i3.png"></i>
      <h3 class="tit">消费记录</h3>
    </a>
    <a href="javascript:;" onClick="ts()"> <i class="icon"><img src="__PUBLIC__/home/images/pPersonal-i4.png"></i>
      <h3 class="tit">消息中心</h3>
    </a>
  </div>
</div>
<!--main End--> 
<script>
  function ts() {
      layer.msg('功能升级维护中..',{icon:2,time:2000});
  }
</script>

<style type="text/css">
 .enlargeImg_wrapper {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-size:100% auto;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  background-color:#000;
}

</style>

<script type="text/javascript">
	$(function() {
		enlargeImg();
	})
	//查看大图
	function enlargeImg() {
	  $(".enlargeImg").click(function() {
	    $(this).after("<div onClick='closeImg()' class='enlargeImg_wrapper'></div>");
	    var imgSrc = $(this).attr('src');
	    $(".enlargeImg_wrapper").css("background-image", "url(" + imgSrc + ")");
	    $('.enlargeImg_wrapper').fadeIn(200);
	  })
	}
	//关闭并移除图层
	
	function closeImg() {
	  $('.enlargeImg_wrapper').fadeOut(200).remove();
	}
	
	
    </script>


<include file="public/footer"/>

</body>
</html>
